'''
作业一：
为了统计学生人数，可以给Student类增加一个类属性，每创建一个实例，该属性自动增加：
class Student(object):
	count = 0
	def __init__(self, name):
		self.name = name
'''

class Student(object):
    count = 0
    def __init__(self, name):
        self.name = name
        Student.count += 1   # 添加的代码


# 验证：
xiaolv = Student('xiaolv')
print(Student.count)
print(xiaolv.count)
xiaolv2 = Student('xiaolv2')
print(Student.count)
print(xiaolv2.count)
xiaolv3 = Student('xiaolv3')
print(xiaolv3.count)
print(Student.count)